<template>
  <div>
    <tr>
      <td>
        <input
          type="number"
          :value="obj.count"
          @input="art"
        />
      </td>
      <td>{{ obj.goodsName }}</td>
      <td>{{ obj.count === 0 ? "卖光了" : " " }}</td>
    </tr>
  </div>
</template>

<script>
export default {
  props: {
    obj: {
      type: Object,
      required: true,
    },
  },
  data() {
    return {};
  },

  created() {},

  methods: {
    art(e){
      if(e.target.value<0){
        e.target.value=0;
        return
      }else{
        this.$emit('add', e.target.value)
      }
    }
  },
};
</script>

<style scoped lang="less"></style>
